jQuery(document).ready(function($){
var s=$('#shangxia').offset().top;$(window).scroll(function(){$("#shangxia").animate({top:$(window).scrollTop()+s+"px"},{queue:false,duration:500})});$body=(window.opera)?(document.compatMode=="CSS1Compat"?$('html'):$('body')):$('html,body');$('#shang').click(function(){$body.animate({scrollTop:'0px'},400)});$('#xia').click(function(){$body.animate({scrollTop:$('#footer').offset().top},400)});$('#comt').click(function(){$body.animate({scrollTop:$('#comments').offset().top},400)});
$('#postlist .post-home .post-title').click(function(){if($(this).next().is(':visible')){$(this).children().children().text('页面载入中……');window.location = $(this).children().children().attr('href')}else{$('#postlist .post-home .post-content').slideUp(300);$(this).next().slideDown(300,function(){$body.animate({scrollTop:$(this).offset().top - 200}, 400);})}return false});$('#postlist .post-home  .post-content').eq(0).show(0);
$("#postlist .post-single .post-content a[href^=http://www.rayfile.com]").addClass("rayfile");$("#postlist .post-single .post-content a[href$=.zip],#postlist .post-single .post-content a[href$=.7z],#postlist .post-single .post-content a[href$=.rar]").addClass("zip");$("#postlist .post-single .post-content a[href$=.doc]").addClass("doc");$("#postlist .post-single .post-content a[href$=.pdf]").addClass("pdf");
$('#postlist .post-cate .post-title').click(function(){var postId = $(this).parent().attr("id").replace(/^post-(.*)$/, '$1');var postContent = $(this).next();if($(this).next().html() == ""){$(this).children().css('color', '#000');$.ajax({url: "?action=ajax_post&id=" + postId,beforeSend:function(){postContent.html('<p style="padding:5px;text-align:center;">努力加载中，请稍等……</p>').slideDown(300);},success:function(data){$('#postlist .post-cate .post-content').hide(0);postContent.html(data).slideDown(300)}})}else if($(this).next().is(":hidden")){$('#postlist .post-cate .post-content').slideUp(300);postContent.slideDown(300)}else{$(this).children().children().text('页面载入中……');window.location = $(this).children().attr('href')}return false});
$("#menu ul li#on,#menu ul li.page_item,#menu ul li.cat-item").hover(function(){$(this).stop().animate({paddingTop:"+=6"},240)},function(){$(this).stop().animate({paddingTop:"0"},120)});
$("#postlist .post-home .post-title h2 a,#tab-content ul li a").hover(function(){$(this).stop().animate({marginLeft:"+=8"},250)},function(){$(this).stop().animate({marginLeft:"0"},150)})
$('#tab-title span').click(function(){$(this).addClass("selected").siblings().removeClass();$("#tab-content > ul").slideUp('1500').eq($('#tab-title span').index(this)).slideDown('1500')});
$('#comments .vcard a').attr({target:"_blank"});$("#comments .commentmetadata span").click(function(){$(this).toggleClass('click').parent().parent().next('.children').slideToggle('1500');});$('#comments .comment-body').dblclick(function(){if($(this).next('#respond').length > 0) {$('#cancel-comment-reply a').click()}else{$(this).children('.reply').children('a').click()}return false});$('#comments .live').live('dblclick',function(){$(this).next().children('a').click()});
// function scrollBox(){var first=$('#scrollbox ul li:first');var width=-(first.outerWidth(true))+'px';$('#scrollbox ul').animate({left:width},{duration:600,complete:function(){$('#scrollbox ul').append(first).css("left","0")}})};$(document).ready(function(){myScroll=setInterval(scrollBox,1500);$('#scrollbox').hover(function(){clearInterval(myScroll)},function(){myScroll=setInterval(scrollBox,1500)})})
$('a,input[type="submit"],object').bind('focus',function(){if(this.blur){ this.blur();}});

//add by zww
(function(){
	$("#rss,#feed").hover(function(){
		if(!$("#rss").children("ul").is(":animated")){
			$("#rss").children("ul").slideDown("800");
		}
	},function(){
		$("#rss").children("ul").slideUp("400");
	});
	$('.comment_c div.reply').hide();
	$('.comment_c').hover(function(){$(this).find('div.reply:first').show();},function(){$(this).find('div.reply:first').hide();});
	//scrollBox
	myScroll = setInterval(scrollBox,1500);
	$('#scrollbox').hover(function(){
		clearInterval(myScroll);
	},function(){
		myScroll = setInterval(scrollBox,1500);
	}
	);
	//移除 more
	$('.content_banner .text p a.more-link').remove();
})();

});
function scrollBox(){
	var first = $('#scrollbox ul li:first');
	var width = -(first.outerWidth(true)) + 'px';
	$('#scrollbox ul').animate({left:width},{
		duration:400,
		complete:function(){
			$('#scrollbox ul').append(first).css("left","0");
		}
	});
};